//
//  Hello_WorldViewController.m
//  Hello World
//
//  Created by Sidney Just on 22.08.09.
//  Copyright Sidney Just 2009. All rights reserved.
//

#import "Hello_WorldViewController.h"
#import "VDead.h"

@implementation Hello_WorldViewController

- (void)rotator {
	tempPanel.rotation += 0.01;
}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
 
	tempDevice = [[[VD_Engine alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Create a Void Dead Device with the mainScreen bounds
	[self.view addSubview:tempDevice]; // Add the Device to the view
	
	tempPanel = [tempDevice->panManager createPanel:0]; // Create a Panel with layer = 0
	tempPanel.texture = [tempDevice->texManager loadATexture:@"HelloWorld.png"]; // Load the HelloWorld.png texture and apply it to the panel
	
	[tempDevice.panManager createDefaultShape:tempPanel]; // Set the atlas mapping to the full texture
	tempPanel.pos_x = 50; // Reposition the panel 
	tempPanel.pos_y = 50; // X = 50 Y = 50
	
	[tempDevice startAnimation]; // Start the rendering
	
	tempDevice.FPSLabelDisplayMode = kDisplayUpLeft;
	
	[tempDevice scheduleRenderCallAt:self withSelector:@selector(rotator)];
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end
